#include "logininterface.h"
#include "ui_logininterface.h"
#include <QDebug>
LoginInterface::LoginInterface(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::LoginInterface)
{
    ui->setupUi(this);
    this->setWindowIcon(QIcon(":/image/loginIcon.ico"));
    this->setWindowTitle("登录");
}

LoginInterface::~LoginInterface()
{
    delete ui;
}

void LoginInterface::slotReturn()
{
    home->close();
    ui->lineEdit_id->clear();
    ui->lineEdit_passwd->clear();
    this->show();
    delete home;
    qDebug() <<"关闭主界面，显示登录界面";
}
void LoginInterface::on_pushButton_login_clicked()
{
    QString id = ui->lineEdit_id->text();
    QString passwd = ui->lineEdit_passwd->text();
    if(id=="1"&&passwd=="1")
    {
        qDebug() <<"登录成功";
        home = new HomeInterface;
        connect(home,&HomeInterface::signalReturn,this,&LoginInterface::slotReturn);
        home->show();
        this->close();
    }

//    qDebug() << "hellow word";
}
